console.log("aaaaaa");
let settings = {};
const radio1 = document.getElementById("radio1");
const radio2 = document.getElementById("radio2");

radio1.addEventListener("click", handleOpen);
radio2.addEventListener("click", handleClose);

function handleOpen(event) {
  console.log("开启");
  

  chrome.runtime.sendMessage({ msgType: "openReminder" });
}

function handleClose(event) {
  console.log("关闭");
  
  chrome.runtime.sendMessage({ msgType: "closeReminder" });
}

chrome.runtime.sendMessage({ msgType: "getSettings" });

chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
  if (message.msgType == "initSetting") {
    console.log("initSetting");
    settings = message.settings;
    radio1.checked = settings.restReminderOpen;
    radio2.checked = !settings.restReminderOpen;
  }
});
